/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.common.domain;

import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * domain基类
 *
 * @author zhangbi617
 * @date 09/05/2017
 */
@MappedSuperclass
public abstract class BaseDomain {

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @CreatedDate
    private Date createTime;

    /**
     * 创建人
     */
    @Column(name = "create_by")
    @CreatedBy
    private Long createBy;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    @LastModifiedDate
    private Date updateTime;

    /**
     * 最后修人
     */
    @Column(name = "update_by")
    @LastModifiedBy
    private Long updateBy;

    /**
     * 创建时间
     *
     * @param createTime the value for create_time
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 创建时间
     *
     * @return createTime the value for create_time
     */
    public Date getCreateTime() {
        return this.createTime;
    }

    /**
     * 创建人
     *
     * @param createBy the value for create_by
     */
    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    /**
     * 创建人
     *
     * @return createBy the value for create_by
     */
    public Long getCreateBy() {
        return this.createBy;
    }

    /**
     * 修改时间
     *
     * @param updateTime the value for update_time
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * 修改时间
     *
     * @return updateTime the value for update_time
     */
    public Date getUpdateTime() {
        return this.updateTime;
    }

    /**
     * 最后修人
     *
     * @param updateBy the value for update_by
     */
    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    /**
     * 最后修人
     *
     * @return updateBy the value for update_by
     */
    public Long getUpdateBy() {
        return this.updateBy;
    }

    @Override
    public String toString() {
        return "BaseDomain{" +
                "createTime=" + createTime +
                ", createBy=" + createBy +
                ", updateTime=" + updateTime +
                ", updateBy=" + updateBy +
                '}';
    }
}
